<?php
// +----------------------------------------------------------------------
// | FileName: CheckSystem.php
// +----------------------------------------------------------------------
// | Date: 2023/3/22 11:58:42
// +----------------------------------------------------------------------
// | Author: 默毅 <moyi@mymoyi.cn>
// +----------------------------------------------------------------------
// | Notes: 
// +----------------------------------------------------------------------
	
	namespace App\Crontab;
	
	use App\Service\Library\CommonService;
	use App\Service\Library\DrawingService;
	use Hyperf\Contract\StdoutLoggerInterface;
	use Hyperf\Crontab\Annotation\Crontab;
	use Hyperf\Di\Annotation\Inject;
	
	#[Crontab(rule: "*/60 * * * * *", name: "startTask", callback: "execute", memo: "这是一个示例的定时任务",enable: false)]
	class CheckSystem
	{
		#[Inject]
		private StdoutLoggerInterface $logger;
		
		#[Inject]
		private DrawingService $DrawingService;
	
		
		public function execute()
		{
//			$this->DrawingService->startTask();
			$this->logger->info('这是方法定时执行'.date('Y-m-d H:i:s', time()));
		}
		
		#[Crontab(rule: "* * * * */10", memo: "foo",enable: false)]
		public function foo()
		{
			$this->logger->info('这是foo方法定时执行'.date('Y-m-d H:i:s', time()));
			
		}
	}